class PrimeNumbers {
	public static void main(String[] args) {
		UserInput input = new UserInput();
		int number = input.getNumber("Please enter number:");
		boolean isPrime;
		for (int i = 1; i <= number; i = i + 1) {
			isPrime = true;
			for (int j = 2; j < i; j = j + 1) {
				if (i % j == 0) {
					isPrime = false;
					break;
				}
			}
			if(isPrime) {
				System.out.print(i + " ");
			}
		}
	}
}